package com.demo.repository;

import java.util.Collection;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;

import com.demo.domain.Admin;

/**
 * 用户User CrudRepository定义
 * 
 * @author jiekechoo
 *
 */
@RestResource(exported = false)
public interface AdminRepository extends CrudRepository<Admin, String> {

	Collection<Admin> findAll();

	Collection<Admin> findByUsername(String username);

	Page<Admin> findAll(Pageable p);

	Page<Admin> findByUsernameContaining(String searchPhrase, Pageable p);
	
	Page<Admin> findByRoleCode(String roleCode,Pageable p);
	
}
